// 提醒
Vue.component('ht-remind', {
    name:'ht-remind',
    template: `
        <el-dialog title="提醒" :visible.sync="show" v-cloak
            :destroy-on-close="true" width="70%" @close="close"
            :append-to-body="true" z-index="9999999">
            <remind_manager v-if="row.type == 'manager'" :row="row"></remind_manager>
            <remind_salesman v-if="row.type == 'salesman'" :row="row"></remind_salesman>
            <remind_survey v-if="row.type == 'survey'" :row="row"></remind_survey>
            <remind_material v-if="row.type == 'material'" :row="row"></remind_material>
            <remind_case v-if="row.type == 'case'" :row="row"></remind_case>
            <remind_evidence v-if="row.type == 'evidence'" :row="row"></remind_evidence>
            <remind_money v-if="row.type == 'money'" :row="row"></remind_money>
        </el-dialog>
    `,
    props: {
        row:{
            type:Object,
            default:()=>{
                return {

                }
            }
        },
        show:{
            type:Boolean,
            default:false
        },
    },
    data() {
        return {

        }
    },
    created() {
        console.log(this.show)
    },
    methods: {
        close(){
            this.$emit('update:show',false)
        },

    },
    watch: {

    }
})
// 业务
Vue.component('remind_salesman', {
    name:'remind_salesman',
    template: `
        <div>
            <div v-if="row.honors.length">
                <div class="ht-title">未导入荣誉证书的项目</div>
                <div v-for="item in row.honors" :key="item.id">
                    <el-link type="primary" @click="openProject(item)">{{item.title}}</el-link>
                </div>
            </div>
            <div v-if="row.cert.length">
                <div class="ht-title">未导入权利证书的项目</div>
                <div v-for="item in row.cert" :key="item.id">
                    <el-link type="primary" @click="openProject(item)" >{{item.title}}</el-link>
                </div>
            </div>
        </div>
    `,
    props: {
        row:{
            type:Object,
            default:()=>{
                return {

                }
            }
        },
    },
    data() {
        return {

        }
    },
    created() {

    },
    methods: {
        close(){
            this.$emit('update:show',false)
        },
        open(row) {
            window.open("/admin/lawyer.project_item/index?id=" + row.id,"_blank","width=1400,height=1000")
        },
        openProject(row) {
            window.open("/admin/lawyer.project/salesman?id=" + row.id,"_blank","width=1400,height=1000")
        }
    },
    watch: {

    }
})
// 经理
Vue.component('remind_manager', {
    name:'remind_manager',
    template: `
        <div>
            <div v-if="row.project.length">
                <div class="ht-title">两个月没有案件的项目</div>
                <div v-for="item in row.project" :key="item.id">
                    <el-link type="primary" @click="openProject(item)">{{item.title}}</el-link>
                </div>
            </div>
            <div v-if="row.yi_item.length">
                <div class="ht-title">两个月没有移交的案件</div>
                <div v-for="item in row.yi_item" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.title}}</el-link>
                </div>
            </div>
            <div v-if="row.project_item.length">
                <div class="ht-title">以下案件需分配律师，请及时处理</div>
                <div v-for="item in row.project_item" :key="item.id">
                    <el-link type="primary" @click="open(item)" >{{item.shop_title}}</el-link>
                </div>
            </div>
        </div>
    `,
    props: {
        row:{
            type:Object,
            default:()=>{
                return {

                }
            }
        },
    },
    data() {
        return {

        }
    },
    created() {

    },
    methods: {
        close(){
            this.$emit('update:show',false)
        },
        open(row) {
            window.open("/admin/lawyer.project_item/index?id=" + row.id,"_blank","width=1400,height=1000")
        },
        openProject(row) {
            window.open("/admin/lawyer.project/index?id=" + row.id,"_blank","width=1400,height=1000")
        }
    },
    watch: {

    }
})
// 调查
Vue.component('remind_survey', {
    name:'remind_survey',
    template: `
        <div>
            <div v-if="row.project.length">
                <div class="ht-title">两个月没有案件的项目</div>
                <div v-for="item in row.project" :key="item.id">
                    <el-link type="primary" @click="openProject(item)">{{item.title}}</el-link>
                </div>
            </div>
        </div>
    `,
    props: {
        row:{
            type:Object,
            default:()=>{
                return {

                }
            }
        },
    },
    data() {
        return {

        }
    },
    created() {
        console.log(this.row)
    },
    methods: {
        close(){
            this.$emit('update:show',false)
        },
        open(row) {
            window.open("/admin/lawyer.project_item/index?id=" + row.id,"_blank","width=1400,height=1000")
        },
        openProject(row) {
            window.open("/admin/lawyer.project/index?id=" + row.id,"_blank","width=1400,height=1000")
        }
    },
    watch: {

    }
})
// 材料
Vue.component('remind_material', {
    name:'remind_material',
    template: `
        <div>
            <div v-if="row.plaint_no_send.length">
                <div class="ht-title">诉状未寄出的案件</div>
                <div v-for="item in row.plaint_no_send" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}</el-link>
                </div>
            </div>
            <div v-if="row.plaint_no_back.length">
                <div class="ht-title">诉状未返回的案件</div>
                <div v-for="item in row.plaint_no_back" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}</el-link>
                </div>
            </div>
            <div v-if="row.notary.length">
                <div class="ht-title">未核验公证书的案件</div>
                <div v-for="item in row.notary" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}</el-link>
                </div>
            </div>
            <div v-if="row.report.length">
                <div class="ht-title">未返回鉴定报名的案件</div>
                <div v-for="item in row.report" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}</el-link>
                </div>
            </div>
            <div v-if="row.item.length">
                <div class="ht-title">未移交律师案件的案件</div>
                <div v-for="item in row.item" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}</el-link>
                </div>
            </div>
        </div>
    `,
    props: {
        row:{
            type:Object,
            default:()=>{
                return {

                }
            }
        },
    },
    data() {
        return {

        }
    },
    created() {
        console.log(this.row)
    },
    methods: {
        close(){
            this.$emit('update:show',false)
        },
        open(row) {
            window.open("/admin/lawyer.material/index?id=" + row.id,"_blank","width=1400,height=1000")
        },
        openProject(row) {
            window.open("/admin/lawyer.project/index?id=" + row.id,"_blank","width=1400,height=1000")
        }
    },
    watch: {

    }
})
// 案件
Vue.component('remind_case', {
    name:'remind_case',
    template: `
        <div>
            <div v-if="row.yi.length">
                <div class="ht-title">未移交律师的案件</div>
                <div v-for="item in row.yi" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}-{{item.lawyer ? item.lawyer.name : ''}}</el-link>
                </div>
            </div>
            <div v-if="row.one.length || row.two.length">
                <div class="ht-title">待跟进的案件</div>
                <div v-for="item in row.one" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}-{{item.lawyer ? item.lawyer.name : ''}}</el-link>
                </div>
                <div v-for="item in row.two" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}-{{item.lawyer ? item.lawyer.name : ''}}</el-link>
                </div>
            </div>
            
        </div>
    `,
    props: {
        row:{
            type:Object,
            default:()=>{
                return {

                }
            }
        },
    },
    data() {
        return {

        }
    },
    created() {
        console.log(this.row)
    },
    methods: {
        close(){
            this.$emit('update:show',false)
        },
        open(row) {
            window.open("/admin/lawyer.law_case/index?id=" + row.id,"_blank","width=1400,height=1000")
        },
        openProject(row) {
            window.open("/admin/lawyer.law_case/index?id=" + row.id,"_blank","width=1400,height=1000")
        }
    },
    watch: {

    }
})
// 物证
Vue.component('remind_evidence', {
    name:'remind_evidence',
    template: `
        <div>
            <div v-if="row.in.length">
                <div class="ht-title">需要入库的案件</div>
                <div v-for="item in row.in" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}</el-link>
                </div>
            </div>
            <div v-if="row.out.length">
                <div class="ht-title">需要出库的案件</div>
                <div v-for="item in row.out" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}</el-link>
                </div>
            </div>
        </div>
    `,
    props: {
        row:{
            type:Object,
            default:()=>{
                return {

                }
            }
        },
    },
    data() {
        return {

        }
    },
    created() {
        console.log(this.row)
    },
    methods: {
        close(){
            this.$emit('update:show',false)
        },
        open(row) {
            window.open("/admin/lawyer.evidence/index?id=" + row.id,"_blank","width=1400,height=1000")
        },
        openProject(row) {
            window.open("/admin/lawyer.evidence/index?id=" + row.id,"_blank","width=1400,height=1000")
        }
    },
    watch: {

    }
})
// 财务
Vue.component('remind_money', {
    name:'remind_money',
    template: `
        <div>
            <div v-if="row.item.length">
                <div class="ht-title">款到权利人未结案的案件</div>
                <div v-for="item in row.item" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}</el-link>
                </div>
            </div>
            <div v-if="row.two.length">
                <div class="ht-title">款到未给权利人结算的案件</div>
                <div v-for="item in row.two" :key="item.id">
                    <el-link type="primary" @click="open(item)">{{item.shop_title}}</el-link>
                </div>
            </div>
        </div>
    `,
    props: {
        row:{
            type:Object,
            default:()=>{
                return {

                }
            }
        },
    },
    data() {
        return {

        }
    },
    created() {
        console.log(this.row)
    },
    methods: {
        close(){
            this.$emit('update:show',false)
        },
        open(row) {
            window.open("/admin/lawyer.money/index?id=" + row.id,"_blank","width=1400,height=1000")
        },
        openProject(row) {
            window.open("/admin/lawyer.money/index?id=" + row.id,"_blank","width=1400,height=1000")
        }
    },
    watch: {

    }
})